package com.cinyi.ormx.android.model;

import java.util.HashSet;
import java.util.Set;

import com.cinyi.ormlite.annotation.TConstrains;
import com.cinyi.ormlite.annotation.TField;
import com.cinyi.ormlite.annotation.TOne2many;
import com.cinyi.ormlite.annotation.TTable;
import com.cinyi.ormx.android.App;
import com.cinyi.ormx.android.model.AndroidBaseModel;

@TTable( "tresourcetype")
public class Tresourcetype extends AndroidBaseModel<Tresourcetype> {

	@TField(name="id",constrains=@TConstrains(primaryKey=true),length=36)
	private String id;
	
	@TField(name = "name",constrains=@TConstrains(notNull=true) , length=100)
	private String name;
	
	@TOne2many(type=Tresource.class,lazy=true,ref="")
	private Set<Tresource> tresources = new HashSet<Tresource>(0);

	public Tresourcetype() {
		super(App.getInstance().getApplicationContext());
	}

	public Tresourcetype(String id, String name) {
		super(App.getInstance().getApplicationContext());
		this.id = id;
		this.name = name;
	}


	public String getId() {
		return this.id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Set<Tresource> getTresources() {
		return this.tresources;
	}

	public void setTresources(Set<Tresource> tresources) {
		this.tresources = tresources;
	}

}
